
<?php $customner = Mage::getSingleton('customer/session')->getCustomer();
    $ids = array();
    if(!empty($customner))
        $ids = $customner->getPrimaryAddressIds();

?>
<?php if(empty($ids) && !empty($customer)): ?>
    <div id="messages">
        <ul class="messages">
            <li class="success-msg">
                <ul>
                    <li>
                        <span><?php echo $this->__("You are using facebook account for checkout, Your accout will created after you check out your cart successfull") ?></span>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
<?php endif; ?>
    
        <div class="wrapper-slider">
            
            
                <?php
                    $bannerCollection = Mage::helper("bannerslider")->getBannerCollection();
                    $mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
                ?>
                <div id="slides">
                    <div class="slides_container">
                        <?php foreach ($bannerCollection as $banner): ?>
                            <div class="slide">
                                <img widht="992" height="248" src="<?php echo $mediaUrl.$banner->getFilename() ?>"  alt="" onclick="window.location='<?php echo $banner->getWeblink() ?>'"/>
                                <div class="intro">
                                    <?php echo $banner->getContent() ?>
                                 </div>
                            </div>
                        <?php endforeach; ?>
                     </div>
                    <a href="javascript:void(0)" class="prev"><img src="<?php echo $this->getSkinUrl("images/prebar.png") ?>" width="13" height="35" alt="Arrow Prev"></a>
                    <a href="javascript:void(0)" class="next"><img src="<?php echo $this->getSkinUrl("images/nextbar.png") ?>" width="13" height="35" alt="Arrow Next"></a
                </div>
              
            

        </div>
</div>
            <div class="product-by-cate clearfix">
                <?php $categoryList =  $this->getCategoryListOnHome() ?>
                
                <?php if(count($categoryList) > 0): ?>
                <h6><?php echo $this->__("SHOP BY CATEGORY") ?> </h6>
                
                <ul class="list-product">
                    <?php $i = 1;?>
                    <?php foreach ($categoryList as $_cate): ?>
                    
                    <?php $class = "" ?>
                    <?php if(($i % NUMBER_PICTURE_ON_HOMEPAGE)==0): ?>
                        <?php $class = "class='last'" ?>
                    <?php endif; ?>
                    <li <?php echo $class ?> >
                        <?php $thumbnail = $this->getThumbnailImageUrl($_cate) ?>
                        <?php $default = $this->getSkinUrl("images/media/default.jpg") ?>
                        <?php if(!empty($thumbnail)): ?>
                            <div class="border-img"><a href="<?php echo $_cate->getUrl() ?>"><img src="<?php echo $thumbnail  ?>" alt=""/></a></div>
                        <?php else: ?>
                            <div class="border-img"><a href="<?php echo $_cate->getUrl() ?>"><img src="<?php echo $default  ?>" alt=""/></a></div>
                        <?php endif; ?>
                        <p class="name-product"><?php echo $_cate->getName() ?></p>
                    </li>
                    
                    <?php if(($i % NUMBER_PICTURE_ON_HOMEPAGE)==0): ?>
                        <?php break; ?>
                    <?php endif; ?>
                    <?php $i++;?>
                    <?php endforeach;?>
                   
                </ul>
                <?php endif; ?>
            </div>
            <div class="product-by-brand clearfix">
                <p><?php echo $this->__("SHOP BY BRAND") ?></p>
                <?php $manufacturer_list = $this->getAllManufacture() ?>
                <?php if(count($manufacturer_list) > 0): ?>
                <ul class="list-brand">
                    <?php foreach( $manufacturer_list as $manu): ?>
                    <li><a href="<?php echo $this->getUrl("catalogsearch/result/index")."?q=1&manufacturer=".$manu['value']?>"><?php echo $manu['label'] ?> </a></li>
                    
                    <?php endforeach; ?>
                </ul>
                <div class="clear"></div>
                <?php endif; ?>
            </div> 
     
    
    


<script type="text/javascript">
		jQuery(function(){
			// Set starting slide to 1
			var startSlide = 1;
			// Get slide number if it exists
			if (window.location.hash) {
				startSlide = window.location.hash.replace('#','');
			}
			// Initialize Slides
			jQuery('#slides').slides({
				preload: true,
				preloadImage: 'images/loading.gif',
				generatePagination:true,
				play: 60000,
				pause: 2500,
				hoverPause: false,
				// Get the starting slide
				start: startSlide,
				animationComplete: function(current){
					// Set the slide number as a hash
					window.location.hash = '#' + current;
				}
			});
		});
</script>
<!--[if lt IE 9]>
<style type="text/css">
	.block, .col2-left-layout .col-main, .bn-list { behavior: url(PIE.htc); }
</style>
<![endif]-->